$themeList: (
  "daytime-theme": (
    // 主要颜色
    "primary-color": #ffffff,
    // 主要颜色-暗
    "primary-color-dark": #f8f8f8,
    // 主要颜色-浅
    "primary-color-light": #d1c4e9,
  ),
  "night-theme": (
    "primary-color": #2d2e36,
    "primary-color-dark": #23242b,
    "primary-color-light": #464753,
  ),
  "purple-theme": (
    "primary-color": #673ab7,
    "primary-color-dark": #512da8,
    "primary-color-light": #d1c4e9,
  ),
);

// 设置父类主题。$property:css属性名称，$name:对象元素的key
@mixin setThemes($property, $name) {
  @each $key, $value in $themeList {
    .#{$key} & {
      #{$property}: map-get($value, $name);
    }
  }
}

// 最外层父元素
// .test {
//   @include setThemes("color", "primary-color");
// }


// 设置元素的主题。$property:css属性名称，$name:对象元素的key，$connector:连接符
@mixin setSelfThemes($property, $name,$connector:'') {
  @each $key, $value in $themeList {
    #{$connector}.#{$key} {
      #{$property}: map-get($value, $name);
    }
  }
}

// 子元素
// .test {
//   @include setSelfThemes("color", "primary-color");
// }

// 自身
// .test {
//   @include setSelfThemes("color", "primary-color","&");
// }


